package daphne.noterun.events
{
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	
	/**
	 * This singleton handles the second and recieivng of custom events that don;t
	 * fit into the display object hierarchy.
	 */
	public class MyEventDispatcher extends EventDispatcher
	{
		private static var instance:MyEventDispatcher = null;
		
		public function MyEventDispatcher():void {
			if (instance != null)
			{
				// this shouldn't be necessary unless they fake out the compiler:
				throw new Error("Error: Instantiation failed: Use SingletonDemo.getInstance() instead of new.");
			}
		}
		
		public static function getInstance():MyEventDispatcher {
			if (instance == null) {
				instance = new MyEventDispatcher();
			}
			return instance;
		}
		
	}
}